{extend name="base" /}
{block name="title"}
<title>付款-{$site_config.site_title}</title>
{/block}
{block name="body"}
<style type="text/css">
#h-submit {width: 100%;float: left;padding: 3% 0;font-size: 18px;text-align: center;color: #c3c3c3;border: 0;}
.members_prepaid_center_list { background-color: #fff;}
</style>
	<header class="page-header1">
		<!-- <a href="javascript:;" onClick="javascript:history.back(-1);"><img src="__STATIC__/img/back02.png" class="back_img" style="float:left;"/></a> -->
        <a href="{:url('home/user/index')}"><img src="__STATIC__/img/back02.png" class="back_img" style="float:left;"/></a>
		<h3>付款</h3>
	</header>
    <form id="h-form">
	<div class="set_amount">
		<div class="set_amount_center">
            <div class="amount_of" style="border-bottom:1px solid #d2d2d2;">
                <div class="amount_of_name" style="width: 100%;">商家：{$pay_user.user_name}</div>
            </div>
			<div class="amount_of" style="border-bottom:1px solid #d2d2d2;">
				<div class="amount_of_name">金额：</div>
				<div class="amount_of_write">
					<input type="number" placeholder="输入金额" class="amount_of_inp" id="amountname" value="" name="money" />
				</div>
			</div>
            <div class="amount_of" style="border-bottom:1px solid #d2d2d2;">
                <div class="amount_of_name" style="color: #ec5e2a;width: 100%;">请选择付款钱包</div>
            </div>
            <div class="members_prepaid_center_list">
                <div class="members_prepaid_center_list_center">已释放激活积分<span style="color: #ec5e2a;">（{$user_info.re_reg_integral}）</span></div>
                <div class="members_prepaid_center_list_right">
                    <div class="timecar-radio">
                        <label for="timecar" onselectstart="return false" class="">
                            <input type="radio" name="type" id="timecar3" value="2" checked="true">
                        </label>
                    </div>
                </div>
            </div>
            <div class="members_prepaid_center_list">
                <div class="members_prepaid_center_list_center">已释放分享积分<span style="color: #ec5e2a;">（{$user_info.re_share_integral}）</span></div>
                <div class="members_prepaid_center_list_right">
                    <div class="timecar-radio">
                        <label for="timecar" onselectstart="return false" class="timecar-radioed">
                            <input type="radio" name="type" id="timecar3" value="6">
                        </label>
                    </div>
                </div>
            </div>
            <div class="members_prepaid_center_list">
                <div class="members_prepaid_center_list_center">已释放消费积分<span style="color: #ec5e2a;">（{$user_info.re_consume_integral}）</span></div>
                <div class="members_prepaid_center_list_right">
                    <div class="timecar-radio">
                        <label for="timecar" onselectstart="return false" class="timecar-radioed">
                            <input type="radio" name="type" id="timecar3" value="4">
                        </label>
                    </div>
                </div>
            </div>
            <div class="members_prepaid_center_list">
                <div class="members_prepaid_center_list_center">增值宝<span style="color: #ec5e2a;">（{$user_info.balance}）</span></div>
                <div class="members_prepaid_center_list_right">
                    <div class="timecar-radio">
                        <label for="timecar" onselectstart="return false" class="timecar-radioed">
                            <input type="radio" name="type" id="timecar3" value="7">
                        </label>
                    </div>
                </div>
            </div>
            <div class="members_prepaid_center_list">
                <div class="members_prepaid_center_list_center">在线支付<span style="color: #ec5e2a;"></span></div>
                <div class="members_prepaid_center_list_right">
                    <div class="timecar-radio">
                        <label for="timecar" onselectstart="return false" class="timecar-radioed">
                            <input type="radio" name="type" id="timecar3" value="100">
                        </label>
                    </div>
                </div>
            </div>
		</div>
		<div class="prepaid_card_confirm_input btu_next">
			<!-- <div id="h-submit">提交</div> -->
            <input type="hidden" name="pay_uid" value="{$uid}">
            <button type="button" id="h-submit">确认支付</button>
		</div>
		
		<div style="clear:both;"></div>
	</div>
    </form>
	<script type="text/javascript">
    window.onload =function()
    {
        {empty name="$pay_money"}
        document.getElementById("h-submit").style.backgroundImage ="url(__STATIC__/img/confirm_01.png)";
        {else/}
        document.getElementById("h-submit").style.backgroundImage ="url(__STATIC__/img/confirm_02.png)";
        document.getElementById("h-submit").style.color ="#fff";
        {/empty}
        /*document.getElementById("btu_set").style.backgroundImage ="url(__STATIC__/img/confirm_01.png)";*/
         document.getElementById("h-submit").style.backgroundSize ="100% 100%";
        //鼠标悬停在按钮上时判断。
        document.getElementById("amountname").onkeyup = function()
        {
            if(document.getElementById("amountname").value=="")
            {
                document.getElementById("h-submit").style.backgroundImage ="url(__STATIC__/img/confirm_01.png)";
                document.getElementById("h-submit").style.backgroundSize ="100% 100%";
                document.getElementById("h-submit").innerHTML="确认支付";
            }else
            {
                document.getElementById("h-submit").style.backgroundImage ="url(__STATIC__/img/confirm_02.png)";
                document.getElementById("h-submit").style.backgroundSize ="100% 100%";
                document.getElementById("h-submit").style.color ="#fff";
                document.getElementById("h-submit").innerHTML="确认支付";
            }
        }
    }
    </script>
    <script type="text/javascript">
        $(".timecar-radio label").on('touchstart',function(){
            if($(this).hasClass('timecar-radioed')){
                $(".timecar-radio label").addClass("timecar-radioed")
                $(this).removeClass("timecar-radioed")
            }
        })
    </script>
    <script>
    var SCOPE = {
      'post_url' : "{$post_url}"
    }
    $("#h-submit").click(function(){
        //$("#h-submit").attr("disabled",true);
        var data = $("#h-form").serializeArray();
        postData = {};
        $(data).each(function(i){
           postData[this.name] = this.value;
        });
        // 将获取到的数据post给服务器
        url = SCOPE.post_url;
        $.post(url,postData,function(result){
            if(result.status == 1) {
                dialog.success(result.message,result.url);
            }else if(result.status == 0) {
                // 失败
                dialog.error(result.message,result.url);
                //$("#h-submit").attr("disabled",false);
                return false;
            }else if(result.status == 100){
                window.location.href = result.url;
            }
        },"JSON");
    });
    </script>
    <script src="__JS__/layer/mobile/layer.js" type="text/javascript" charset="utf-8"></script>
    <script src="__JS__/mdialog.js" type="text/javascript" charset="utf-8"></script>
{/block}

